Skip to content

Conversation

vlasovskikh
Copy link
Member

@vlasovskikh vlasovskikh commented Aug 1, 2018

Threads created via threading.Thread didn't invoke sys.excepthook if there was an uncaught exception. Since the docs for sys.excepthook are not specific about using it from threads and, in fact, this hook works for threads created via the _thread module, it makes sense to enable it the threading module as well.

https://bugs.python.org/issue1230540

Threads created via threading.Thread didn't invoke sys.excepthook if
there was an uncaught exception. Since the docs for sys.excepthook are
not specific about using it from threads and, in fact, this hook works
for threads created via the _thread module, it makes sense to enable it
the threading module as well.
@vstinner
Copy link
Member

I dislike this PR: threading.Thread doesn't call sys.excepthook to handle run() exception by default, it only calls sys.excepthook if it's overridden. Moreover, when sys.excepthook is called, the hook doesn't get access to the thread object :-(
https://bugs.python.org/issue1230540#msg343260

I proposed a different approach: PR #13515.

@vstinner
Copy link
Member

I merged a different approach: my PR #13515. Thanks @vlasovskikh anyway for working on this issue ;-)

@vstinner vstinner closed this May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants